#include <iostream>
#include <cstring>
#include <unistd.h>
#include <fcntl.h>

void SetNonBlock(int fd)
{
    // 获取文件状态标志
    int flags = fcntl(fd, F_GETFL);
    if (flags < 0)
    {
        std::cerr << "fcntl " << strerror(errno) << std::endl;
        return;
    }
    // 设置文件状态标志为非阻塞，保持原有标志
    fcntl(fd, F_SETFL, flags | O_NONBLOCK);
}

void printlog()
{
    std::cout << "this is a log" << std::endl;
}
void download()
{
    std::cout << "this is a download" << std::endl;
}
void executeSql()
{
    std::cout << "this is a executeSql" << std::endl;
}